/*手机端自适应ZOOM缩放比例*/
function bodyScale(){
	var devicewidth=document.documentElement.clientWidth;
	var scale=devicewidth/640;
	document.body.style.zoom=scale;
}
window.addEventListener("load",function(){
	bodyScale();
})
window.addEventListener("resize",function(){
	bodyScale();
})

//------此部分为侧滑js效果-------------------------------
$(function(){
	var oBox=document.getElementById("box-wrap")||"";
	var menu=document.getElementById("menu")||"";
	var box=document.getElementById("main-wrap")||"";
	var back=document.getElementById("nav-goback")||"";
	var turn=true;
	if(menu){
		menu.addEventListener("click",come1);
		back.addEventListener("click",come1);
		function come1(ev){
			var e=ev||evemt;
			e.stopPropagation();
			if(turn){
				oBox.style.marginLeft="0px";
			}else{
				oBox.style.marginLeft="-580px";
			}
			turn=!turn;
			box.addEventListener("click",come,false);
			function come(){
				oBox.style.marginLeft="-580px";
				turn=true;
				return false;
			}
		}
		document.addEventListener("touchstart",function(ev){
			var e=ev||event;
			e=e.touches[0];
			var disx1=e.clientX;
			document.addEventListener("touchmove",function(ev){
				var e=ev||event;
				e=e.touches[0];
				var disx2=e.clientX;
				if(Math.abs(disx2-disx1)>300){
					if(disx1>disx2){
						oBox.style.marginLeft="-580px";
						turn=true;
					}else{
						oBox.style.marginLeft="0px";
						turn=false;
					}
				}
			})
		});
	}
		var naviscroll=new IScroll("#nav #nav-iscroll",{})
})
//--------侧滑结束！-------------------